/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.kleintjes.studentclass.Impl;

import za.ac.cput.kleintjes.studentclass.Student;
import za.ac.cput.kleintjes.studentclass.StudentClass;

/**
 *
 * @author Administrator
 */

public class StudentClassImpl implements StudentClass{
    
    private int numberOfStudents = 3;
    private Student studClass[] = new Student[3];

    public StudentClassImpl() {
    }

    public StudentClassImpl(Student copyStudClass[]) {
        studClass = copyStudClass;
    }
    
    public int getNumberOfStudents() {
        return numberOfStudents;
    }

    public void setNumberOfStudents(int numberOfStudents) {
        this.numberOfStudents = numberOfStudents;
    }
    
    @Override
    public double markAve() {
        int subTotal = 0;
        for(int x=0; x<numberOfStudents; x++)
            subTotal += studClass[x].getTotal();
        
        return subTotal/numberOfStudents;
    }
}
